// $Id: text_processing.h 25 2015-02-10 23:30:29Z robim.poa@gmail.com $
//-----------------------------------------------------------------------------
// Purpose: Text processor and interpreter.
// $Rev: 25 $
// $Author: robim.poa@gmail.com $
// $Date: 2015-02-10 23:30:29 +0000 (Tue, 10 Feb 2015) $

#ifndef TEXT_PROCESSING_H
#define TEXT_PROCESSING_H

#include "text_decoding.h"

#define EXPRESSION_TYPE_VAR 1
#define EXPRESSION_TYPE_VALUE 2
#define EXPRESSION_TYPE_OPERATOR 3

#define EXPRESSION_END_PARENTHESES 1
#define EXPRESSION_END_SEMICOLON   2

struct tp_node_expression
{
	int type;
	int data;
	struct tp_node_expression *next;
};


struct tp_node_var
{
	struct       tp_node_var *next;
	char         name[255];
	int          type;
	unsigned int id;
};

void tpReadExpression(struct tp_node_expression *tp_node_expression_head, int kind, struct tp_node_var *node_var_head, FILE *pfile);

// Aux
void tpCreateExpressionNode(struct tp_node_expression *tp_node_expression_head, int type, int data);

void tpCreateVarNode(struct tp_node_var *nodep_var_head, char* buffer, int char_type);

int tpCheckVarExistance(struct tp_node_var *nodep_var_head, char* buffer);

#endif